<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: logoff.php 180 2013-09-22 07:56:06Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 180 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:56:06 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

include('includes/application_top.php');

$smarty = new Smarty();

require(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');

$breadcrumb->add(NAVBAR_TITLE_LOGOFF);

// Lösche Gastkonto Informationen
if(($_SESSION['account_type'] == 1) && (DELETE_GUEST_ACCOUNT == 'true')) {
	$db->db_query("DELETE FROM ".TABLE_CUSTOMERS." WHERE customers_id = '".$_SESSION['customer_id']."'");
	$db->db_query("DELETE FROM ".TABLE_ADDRESS_BOOK." WHERE customers_id = '".$_SESSION['customer_id']."'");
	$db->db_query("DELETE FROM ".TABLE_CUSTOMERS_INFO." WHERE customers_info_id = '".$_SESSION['customer_id']."'");
}

$session->_sess_destroy(session_name());

unset($_SESSION['customer_id']);
unset($_SESSION['customer_default_address_id']);
unset($_SESSION['customer_first_name']);
unset($_SESSION['customer_country_id']);
unset($_SESSION['customer_zone_id']);
unset($_SESSION['comments']);
unset($_SESSION['user_info']);
unset($_SESSION['customers_status']);
unset($_SESSION['selected_box']);
unset($_SESSION['navigation']);
unset($_SESSION['shipping']);
unset($_SESSION['payment']);
unset($_SESSION['ccard']);
unset($_SESSION['gv_id']);
unset($_SESSION['cc_id']);

$_SESSION['cart']->reset();
$_SESSION['wish_list']->reset();

if(!isset($_GET['success']))
	redirect(href_link(FILENAME_LOGOFF, 'success'));

require(DIR_WS_INCLUDES.'write_customers_status.php');

require(DIR_WS_INCLUDES.'header.php');

$smarty->assign('BUTTON_CONTINUE', '<a href="'.href_link(FILENAME_DEFAULT).'">'.image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE).'</a>');
$smarty->assign('language', $_SESSION['language']);
$smarty->caching = false;
$main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/logoff.html');
$smarty->assign('language', $_SESSION['language']);
$smarty->assign('main_content', $main_content);
$smarty->caching = false;
if(!defined('RM'))
	$smarty->loadFilter('output', 'note');
$smarty->loadFilter('output','trimwhitespace');
$smarty->display(CURRENT_TEMPLATE.'/index.html');
include('includes/application_bottom.php');